import json
import sys


def formate_json(json_string):
    """
    获取自定义手机号
    :return:
    """
    parsed_data = json.loads(json_string)
    pretty_json = json.dumps(parsed_data, indent=4)
    print(pretty_json)


def formate_str(json_string):
    """
    获取自定义手机号
    :return:
    """
    parsed_data = json.loads(json_string)
    pretty_json = json.dumps(parsed_data)
    print(pretty_json)


if __name__ == '__main__':
    type = sys.argv[1]
    str = sys.argv[2]
    if type == 'json':
        formate_json(str)
    elif type == 'str':
        formate_str(str)
